# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SourceRepo.V1.Model.MirrorConfig do
  @moduledoc """
  Configuration to automatically mirror a repository from another hosting service, for example GitHub or Bitbucket.

  ## Attributes

  *   `deployKeyId` (*type:* `String.t`, *default:* `nil`) - ID of the SSH deploy key at the other hosting service. Removing this key from the other service would deauthorize Google Cloud Source Repositories from mirroring.
  *   `url` (*type:* `String.t`, *default:* `nil`) - URL of the main repository at the other hosting service.
  *   `webhookId` (*type:* `String.t`, *default:* `nil`) - ID of the webhook listening to updates to trigger mirroring. Removing this webhook from the other hosting service will stop Google Cloud Source Repositories from receiving notifications, and thereby disabling mirroring.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deployKeyId => String.t() | nil,
          :url => String.t() | nil,
          :webhookId => String.t() | nil
        }

  field(:deployKeyId)
  field(:url)
  field(:webhookId)
end

defimpl Poison.Decoder, for: GoogleApi.SourceRepo.V1.Model.MirrorConfig do
  def decode(value, options) do
    GoogleApi.SourceRepo.V1.Model.MirrorConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.SourceRepo.V1.Model.MirrorConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
